 <?php
header("Content-type:text/html;charset=utf-8");
    if(!isset($_POST['dl'])){
        exit('非法访问!');
    }
    $username = $_POST['username'];
    $password = $_POST['password'];

    //包含数据库连接文件
 include('../config.php');
    session_start();
     if(isset($_POST['dl'])) {
        
            if ($username ==  $conf['admin_user'] &&$password == $conf['admin_pwd']) {
               # code //登录成功
                 $_SESSION['username'] = $username;

             header('location:admin.php');
             echo '点击此处 <a href="login.php?action=logout">注销</a> 登录！<br />';
              exit;
             } else {
             exit  ("<script language='javascript'>alert('用户名或密码错误');history.go(-1);</script>");
             }
             
     }

    ?>
